/*
 * Copyright MapStruct Authors.
 *
 * Licensed under the Apache License version 2.0, available at https://www.apache.org/licenses/LICENSE-2.0
 */

import org.example.dto.Car;
import org.example.dto.CarDto;
import org.mapstruct.*;

@Mapper(uses = NotToBeUsedMapper.class)
public interface InheritConfigurationNotInheritedByUsedMapper {

    @InheritConfiguration
    void <warning descr="Unmapped target properties: driver, free, manufacturingDate, numberOfSeats">carDtoIntoCar</warning>(CarDto carDto, @MappingTarget Car car);

}

@Mapper
interface NotToBeUsedMapper {

    @Mapping(target = "numberOfSeats", ignore = true)
    @Mapping(target = "manufacturingDate", source = "manufacturingYear")
    @Mapping(target = "free", source = "available")
    @Mapping(target = "driver", source = "myDriver")
    Car carDtoToCarIgnoringSeatCount(CarDto car);

}
